FROM centos:latest
LABEL author="jerry"
RUN mkdir -p /application &&\
useradd nginx &&\
yum install -y gcc gcc-c++ automake pcre pcre-devel zlib-devel openssl openssl-devel wget make&&\
wget https://nginx.org/download/nginx-1.18.0.tar.gz
RUN tar zxf nginx-1.18.0.tar.gz &&\
cd nginx-1.18.0 &&\
./configure --prefix=/application/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module &&\
make && make install &&\
sed -i 's/#user  nobody/user nginx/g' /application/nginx/conf/nginx.conf &&\
sed -i '1i daemon off;' /application/nginx/conf/nginx.conf
EXPOSE 80
EXPOSE 443
CMD [ "/application/nginx/sbin/nginx" ]